<?php
/**
 * 秒杀 抽象类型定义 公有方法
 */
abstract class KillCommonModel{
    //表的主键
     protected    $goodsId="goods_id";
   //购买商品id
    protected    $goodsIdBy="goodsId";
    
     public    $orderInfo="";
    //库存字段  表的
    protected    $counts="counts";
    //表名
    protected $goodsTable="goods";
    //订单表
    protected $oderModel="order";
    //订单模型类对象
    protected $goodsObj="Goods";
    //订单模型类对象
    protected $oderObj="Order";
    //订单模型类对象
    protected $userId="";

    protected $error="";

    /**
     * @param $orderObj
     */
    public function setOrderObj($orderObj){
        $this->oderObj=$orderObj;
    }

    /**
     * @param $goodsObj
     */
    public function setGoodsObj($goodsObj){
        $this->goodsObj=$goodsObj;
    }
    /**
     * 设置
     * @param $id
     */
    public function setGoodsId($id){
        $this->goodsId=$id;
    }

    /**
     * 设置
     * @param $counts
     */
    public function setCounts($counts){
        $this->counts=$counts;
    }

    /**
     * 设置
     * @param $goodsTable
     */
    public function setGoodsTable($goodsTable){
        $this->goodsTable=$goodsTable;
    }

    /**
     * 设置
     * @param $oderModel
     */
    public function setOderModel($oderModel){
        $this->oderModel=$oderModel;
    }

    /**
     * 获取
     * @return string
     */
    public function getGoodsId(){
        return $this->goodsId;
    }

    /**
     * 获取
     * @return string
     */
    public function getCounts(){
        return $this->counts;
    }

    /**
     * 获取
     * @return string
     */
    public function getGoodsTable(){
        return $this->goodsTable;
    }

    /**
     * 获取
     * @return string
     */
    public function getOderModel(){
        return $this->oderModel;
    }

    /**
     * 获取错误
     * @return string
     */
    public function getError(){
        return $this->error;
    }

    protected function setError($error){
        $this->error=$error;
    }

    public abstract function RunPurchase($id,$userId);


}